import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home/Home.vue'

Vue.use(VueRouter)

const routes = [
  { //路由重定向
    path: "/",
    redirect: "/home"
  },
  { //首页路由
    path: '/home',
    name: 'Home',
    component: Home
  },
  { //分类路由
    path: '/category',
    name: 'Category',
    component: () => import('../views/Category/Category.vue')
  },
  { //发现路由
    path: '/find',
    name: 'Find',
    component: () => import('../views/Find/Find.vue')
  },
  { //购物车路由
    path: '/cart',
    name: 'Cart',
    component: () => import('../views/Cart/Cart.vue')
  },
  { //我的路由
    path: '/mine',
    name: 'Mine',
    component: () => import('../views/Mine/Mine.vue')
  }
]

const router = new VueRouter({
  routes
})

export default router
